ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Newt_Female Class Reference

The newt female class. More...

#include <Newt.h>

Inheritance diagram for Newt_Female:
Newt_Adult Newt_Juvenile Newt_Base TAnimal TALMaSSObject

Public Member Functions

 Newt_Female (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
 Newt_Female constructor. More...
 
 ~Newt_Female ()
 Newt_Female destructor. More...
 
virtual void ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Step (void)
 Newt_Female Step code. This is called continuously until all animals report that they are 'DONE'. More...
 
void ResetEggProduction ()
 
void InternalPesticideHandlingAndResponse ()
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from Newt_Adult
 Newt_Adult (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
 Newt_Adult constructor. More...
 
 ~Newt_Adult ()
 Newt_Male destructor. More...
 
virtual void Init (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age)
 Initialise object. More...
 
int GetInPond ()
 Returns the current pond status (-1 if not in pond else the pond ref is returned) More...
 
void SetInPond ()
 Forces setting the in pond status to the first pond ref - used only on start-up. More...
 
- Public Member Functions inherited from Newt_Juvenile
 Newt_Juvenile (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
 Newt_Juvenile constructor. More...
 
 ~Newt_Juvenile ()
 Newt_Juvenile destructor. More...
 
double GetWeight ()
 Get method for m_weight. More...
 
void SetWeight (double a_weight)
 Set method for m_weight. More...
 
void InternalPesticideHandlingAndResponse ()
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from Newt_Base
 Newt_Base (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Newt constructor. More...
 
void Init (vector< unsigned > a_pond, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 Intitialise object. More...
 
void ReInit (int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, bool a_reproinhib)
 ReInit for object pool. More...
 
 ~Newt_Base ()
 Newt destructor. More...
 
virtual int WhatState ()
 Returns the state number for display purposes. More...
 
TTypeOfNewtState st_Develop (void)
 Behavioural state development - does nothing in the base class. More...
 
TTypeOfNewtState st_Movement (void)
 Behavioural state movement - does nothing in the base class. More...
 
void st_Dying (void)
 Behavioural state dying. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
virtual void EndStep (void)
 The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
unsigned GetAge ()
 A typical interface function - this one returns the Age as an unsigned integer. More...
 
void SetAge (unsigned a_age)
 A typical interface function - this one sets the Age as an unsigned integer. More...
 
unsigned GetHomePond ()
 A typical interface function - this one returns the home pond reference as an unsigned integer. More...
 
void SetHomePond (unsigned a_pond)
 A typical interface function - this one sets the home pond reference as an unsigned integer. More...
 
void InternalPesticideHandlingAndResponse (double)
 For handlng of class-specific pesticide effects. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Static Public Attributes

static unsigned m_eggproductionvolume = cfg_newteggproductionvolume.value()
 Parameter - holds the max number of eggs that can be produced during breeding. More...
 
static unsigned m_eggdailyproductionvolume = cfg_newtdailyeggproductionvolume.value()
 Parameter - holds the number of eggs produced per day during breeding. More...
 
- Static Public Attributes inherited from Newt_Adult
static double m_AdultPPPThreshold = cfg_NewtAdultPPPToxTrigger.value()
 The threshold for effect of PPP on adults. More...
 
static double m_AdultPPPElimRate = cfg_NewtAdultPPPToxEliminationRate.value()
 The daily proportion of PPP body burden that is not eliminated for adults. More...
 
static double m_AdultPPPEffectProbability = cfg_NewtAdultPPPEffectProbability.value()
 The daily probability of effect if above m_AdultPPPThreshold for adults. More...
 
static unsigned m_AdultLifespan = cfg_NewtAdultLifespan.value()
 
static int m_newtadultwalkspeed = cfg_NewtWalkSpeed.value()/10
 The max walking speed of a newt. More...
 
- Static Public Attributes inherited from Newt_Juvenile
static double m_JuvenilePPPThreshold_Min = 0
 The minimum threshold for effect of PPP on juveniles. More...
 
static double m_JuvenilePPPThreshold_EnvConc = cfg_NewtJuvenilePPPToxTrigger_EnvConc.value()
 The environmental concentration threshold for effect of PPP on juveniles. More...
 
static double m_JuvenilePPPThreshold_Overspray = cfg_NewtJuvenilePPPToxTrigger_Overspray.value()
 The overspray threshold for effect of PPP on juveniles. More...
 
static double m_JuvenilePPPElimRate = cfg_NewtJuvenilePPPToxEliminationRate.value()
 The daily proportion of PPP body burden that is not eliminated for juveniles. More...
 
static double m_JuvenilePPPEffectProbability_EnvConc = cfg_NewtJuvenilePPPEffectProbability_EnvConc.value()
 The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for environmental concentration. More...
 
static double m_JuvenilePPPEffectProbability_Overspray = cfg_NewtJuvenilePPPEffectProbability_Overspray.value()
 The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for overspray. More...
 
static double m_JuvenileDailyWeightGain = cfg_NewtJuvenileDailyLengthGain.value()
 Used in determining daily growth. More...
 
static int m_SimW = 0
 The width of the simulation map, stored for fast access. More...
 
static int m_SimH = 0
 The height of the simulation map, stored for fast access. More...
 
static double m_roadmortalityprob = cfg_NewtRoadMortalityProb.value()
 The probability of death when crossing a road. More...
 
static int m_newtwalkspeed = cfg_NewtWalkSpeed.value()
 The max walking speed of a newt. More...
 
static int m_newtwalkstepsize = cfg_NewtWalkStepsize.value()
 The size of a step when evaluating habitat during walking. More...
 
static double m_goodhabitatdispersalprob = cfg_newtgoodhabitatdispersalprob.value()
 Probability of dispersal in good habitat. More...
 
static double m_poorhabitatdispersalprob = cfg_newtpoorhabitatdispersalprob.value()
 Probability of dispersal in poor habitat. More...
 
static double m_NewtDormancyTemperature = cfg_newtdormancytemp.value()
 Temperature in degrees that the newts become dormant. More...
 
static double m_NewtDormancyHumidity = cfg_newtdormancyhumidity.value()
 Temperature in degrees that the newts become dormant. More...
 
- Static Public Attributes inherited from Newt_Base
static double m_EggDevelopmentDDTotal = cfg_NewtEggDevelTotal.value()
 
static double m_EggDevelopmentDDParameter = cfg_NewtEggDevelDDParameter.value()
 
static double m_JuvenileDevelopmentSize = cfg_NewtJuvenileDevelSize.value()
 
static double m_EggMortalityChance = cfg_NewtEggMortalityChance.value()
 
static double m_JuvenileMortalityChance = 0.0
 
static double m_AdultMortalityChance = 0.0
 
static bool m_test_pesticide_egg = cfg_Newt_Test_Pesticide_Egg.value()
 Flags to record whether we are in pesticide testing mode. More...
 
static bool m_test_pesticide_larva = cfg_Newt_Test_Pesticide_Larva.value()
 
static bool m_test_pesticide_terrestrial = cfg_Newt_Test_Pesticide_Terrestrial.value()
 

Protected Member Functions

virtual TTypeOfNewtState st_Develop (void)
 Male development state. More...
 
virtual TTypeOfNewtState st_Breed (void)
 Female breeding in pond. More...
 
virtual TTypeOfNewtState st_EvaluateHabitat (void)
 Adult evaluate habitat behaviour - augmenting the adult behaviour. More...
 
- Protected Member Functions inherited from Newt_Adult
void CalcMovementVector (void)
 Calculates the direction needed to move in to get to the target pond. More...
 
bool AgeMortTest (void)
 Ages the adult and applies a daily mortality probability. More...
 
virtual TTypeOfNewtState st_Disperse (void)
 Adult development state. More...
 
virtual TTypeOfNewtState st_Overwinter (void)
 Adult dormant state. More...
 
virtual TTypeOfNewtState st_Migrate (void)
 Adult migration to pond state. More...
 
- Protected Member Functions inherited from Newt_Juvenile
virtual TTypeOfNewtState st_NextStage (void)
 Juvenile maturation. More...
 
void MoveTo (TTypeDirectedWalk a_directedness, int a_stepsize, int a_steps)
 Top level control of newt movement. More...
 
void NewtDoWalking (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy)
 This method moves the newt through the landscape. More...
 
void NewtDoWalkingCorrect (int &a_vector, int a_stepsize, int a_steps, int &vx, int &vy)
 This method moves the newt through the landscape using wrap around corrects. More...
 
int NewtMoveQuality (int a_x, int a_y, TTypesOfLandscapeElement &a_tole)
 Tests the habitat quality for a square to move to. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

unsigned m_eggsproduced
 Holds the number of eggs produced during breeding. More...
 
bool m_mated
 Flag showing mating status, true means mated this season. More...
 
- Protected Attributes inherited from Newt_Adult
int m_targetpondx
 x-coord of a target pond More...
 
int m_targetpondy
 y-coord of a target pond More...
 
- Protected Attributes inherited from Newt_Juvenile
int m_InPond
 The polyrefindex for the pond the newt is in, or -1 if not in a pond. More...
 
double m_weight
 
unsigned m_OurVector
 The last direction we moved in. More...
 
TTypesOfLandscapeElement m_CurrentHabitat
 The current habitat type the newt is in. More...
 
bool m_forcedisperse
 A flag to force dispersal from the breeding ponds. More...
 
- Protected Attributes inherited from Newt_Base
TTypeOfNewtState m_CurrentNewtState
 Variable to record current behavioural state. More...
 
unsigned m_Age
 
vector< unsigned > m_pondlist
 
Newt_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
double m_body_burden
 The current PPP body burden for use in pesticide testing mode. More...
 
bool m_reproductiveinhibition
 A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent classes) More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

The newt female class.

Constructor & Destructor Documentation

◆ Newt_Female()

Newt_Female::Newt_Female ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
unsigned  a_age,
bool  a_reproinhib 
)

Newt_Female constructor.

Sets the mated status to false and the number of eggs produced to zero

983  : Newt_Adult(a_x, a_y, a_pond, a_L, a_NPM, a_age, a_reproinhib)
984 {
988  m_mated = false;
989  m_eggsproduced = 0;
990 }
Newt_Adult(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
Newt_Adult constructor.
Definition: Newt.cpp:689
bool m_mated
Flag showing mating status, true means mated this season.
Definition: Newt.h:522
unsigned m_eggsproduced
Holds the number of eggs produced during breeding.
Definition: Newt.h:520

References m_eggsproduced, and m_mated.

◆ ~Newt_Female()

Newt_Female::~Newt_Female ( void  )

Newt_Female destructor.

994 {
995  ;
996 }

Member Function Documentation

◆ InternalPesticideHandlingAndResponse()

void Newt_Female::InternalPesticideHandlingAndResponse ( )

For handlng of class-specific pesticide effects.

This method is re-implemented from Newt_Base for any class which has pesticide response behaviour. If the body burden exceeds the trigger then an effect is tested for and implemented depending on the pesticide type.

1310  {
1315  // Test against the threshold level for Adult to determine if an effect needs to be tested for
1317  // We are above the PPP body burden threshold, so make a test for effect
1320  switch (tp) {
1321  case ttop_NoPesticide:
1322  break;
1323  case ttop_ReproductiveEffects: // Reproductive effects
1324  // TODO
1325  break;
1326  case ttop_AcuteEffects: // Acute mortality
1328  KillThis();
1329  break;
1330  case ttop_MultipleEffects:
1331  break;
1332  default:
1333  g_msg->Warn("Unknown pesticide type used in Newt_Female::InternalPesticideHandlingAndResponse() pesticide code ", int(tp));
1334  exit(47);
1335  }
1336  }
1337  }
1338 }
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
@ toNewts_Die
Definition: Newt.h:75
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
static double m_AdultPPPThreshold
The threshold for effect of PPP on adults.
Definition: Newt.h:411
static double m_AdultPPPEffectProbability
The daily probability of effect if above m_AdultPPPThreshold for adults.
Definition: Newt.h:415
TTypeOfNewtState m_CurrentNewtState
Variable to record current behavioural state.
Definition: Newt.h:113
double m_body_burden
The current PPP body burden for use in pesticide testing mode.
Definition: Newt.h:121
virtual void KillThis()
Definition: PopulationManager.h:219
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
TTypesOfPesticide
Definition: landscape.h:66
@ ttop_NoPesticide
Definition: landscape.h:67
@ ttop_AcuteEffects
Definition: landscape.h:68
@ ttop_MultipleEffects
Definition: landscape.h:74
@ ttop_ReproductiveEffects
Definition: landscape.h:69

References g_msg, g_rand_uni, TAnimal::KillThis(), Newt_Adult::m_AdultPPPEffectProbability, Newt_Adult::m_AdultPPPThreshold, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_OurLandscape, Landscape::SupplyPesticideType(), toNewts_Die, ttop_AcuteEffects, ttop_MultipleEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and MapErrorMsg::Warn().

Referenced by st_Develop().

◆ ReInit()

void Newt_Female::ReInit ( int  a_x,
int  a_y,
vector< unsigned >  a_pond,
Landscape a_L,
Newt_Population_Manager a_NPM,
unsigned  a_age,
bool  a_reproinhib 
)
virtual

Used to re-use an object - must be implemented in descendent classes.

Reimplemented from Newt_Adult.

999  {
1000  Newt_Adult::ReInit(a_x, a_y, a_pond, a_L, a_NPM, a_age, a_reproinhib);
1001  m_mated = false;
1002  m_eggsproduced = 0;
1003 }
virtual void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
Used to re-use an object - must be implemented in descendent classes.
Definition: Newt.cpp:701

References m_eggsproduced, m_mated, and Newt_Adult::ReInit().

Referenced by Newt_Population_Manager::CreateObjects().

◆ ResetEggProduction()

void Newt_Female::ResetEggProduction ( )
inline

brief Sets the eggs produced to zero

513  {
514  m_eggsproduced = 0;
515  }

References m_eggsproduced.

◆ st_Breed()

TTypeOfNewtState Newt_Female::st_Breed ( void  )
protectedvirtual

Female breeding in pond.

This is the behaviour of the female in the breeding pond during breeding season. Behaviour consists of:

  • A mortality check against daily mortality chance
  • A check whether breeding season is over, if so change state to normal develop and set mated status to false.
  • A check to see if she is mated or not, if not then look for a mate
  • If mated and not reproductively inhibited, then production of eggs can start. This is a constant rate per day set by the parameter stored in m_eggdailyproductionvolume
  • If the maximum number of eggs has been produced then egg production stops and non-breeding behaviour starts
1067  {
1076 # ifdef __NewtDebug
1077  if (m_InPond == -1) {
1078  g_msg->Warn("Newt_Female calling breeding but not in pond. Pond ref is equal to ", m_InPond);
1079  g_msg->Warn("CurrentStateNo ", m_CurrentStateNo);
1080  g_msg->Warn("x ", this->m_Location_x);
1081  g_msg->Warn("y ", this->m_Location_y);
1083  exit(0);
1084  }
1085 #endif
1086  if (AgeMortTest()) return toNewts_Die;
1088  m_mated = false;
1089  return toNewts_Develop;
1090  }
1091  if (!m_mated) {
1093  return toNewts_Breed;
1094  }
1095  else {
1096  if (!m_reproductiveinhibition) { // No reproduction if affected by pesticide
1097  if (m_eggsproduced < m_eggproductionvolume) { // Must produce some eggs
1098  struct_Newt sN;
1100  sN.L = m_OurLandscape;
1101  sN.age = m_Age;
1102  sN.x = m_Location_x;
1103  sN.y = m_Location_y;
1104  sN.pondrefs.resize(1);
1105  sN.pondrefs[0] = m_InPond;
1106  sN.weight = 0;
1107  sN.reproinhib = false;
1110  return toNewts_Breed;
1111  }
1112  }
1113  }
1114  // We must have produced all our eggs, so stop breeding and return to normal behaviour
1115  m_mated = false;
1116  return toNewts_Develop;
1117 }
@ tton_Egg
Definition: Newt.h:49
@ toNewts_Develop
Definition: Newt.h:67
@ toNewts_Breed
Definition: Newt.h:73
bool SupplyMaleNewtPresent(int a_InPondIndex)
Determines if a male is present in a pond.
Definition: landscape.h:351
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
bool AgeMortTest(void)
Ages the adult and applies a daily mortality probability.
Definition: Newt.cpp:768
bool m_reproductiveinhibition
A flag to indicate environmentally induced reproductive inhibition (value is inherited by descendent ...
Definition: Newt.h:123
Newt_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Newt.h:119
unsigned m_Age
Definition: Newt.h:115
static unsigned m_eggdailyproductionvolume
Parameter - holds the number of eggs produced per day during breeding.
Definition: Newt.h:503
static unsigned m_eggproductionvolume
Parameter - holds the max number of eggs that can be produced during breeding.
Definition: Newt.h:501
int m_InPond
The polyrefindex for the pond the newt is in, or -1 if not in a pond.
Definition: Newt.h:363
void CreateObjects(int ob_type, TAnimal *pvo, struct_Newt *data, int number)
Method for creating a new individual Newt.
Definition: Newt_Population_Manager.cpp:344
int IsBreedingSeason()
Returns whether it is breeding season or not.
Definition: Newt_Population_Manager.h:87
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
Used for creation of a new Newt object.
Definition: Newt_Population_Manager.h:47
bool reproinhib
Holds a reproductive effect flag.
Definition: Newt_Population_Manager.h:64
double weight
Newt weight.
Definition: Newt_Population_Manager.h:58
vector< unsigned > pondrefs
Born x-coord.
Definition: Newt_Population_Manager.h:56
int y
y-coord
Definition: Newt_Population_Manager.h:54
int age
The newt age.
Definition: Newt_Population_Manager.h:50
int x
x-coord
Definition: Newt_Population_Manager.h:52
Landscape * L
Landscape pointer.
Definition: Newt_Population_Manager.h:60
Newt_Population_Manager * NPM
Newt_Population_Manager pointer.
Definition: Newt_Population_Manager.h:62

References struct_Newt::age, Newt_Adult::AgeMortTest(), Newt_Population_Manager::CreateObjects(), g_msg, Newt_Population_Manager::IsBreedingSeason(), struct_Newt::L, Newt_Base::m_Age, TALMaSSObject::m_CurrentStateNo, m_eggdailyproductionvolume, m_eggproductionvolume, m_eggsproduced, Newt_Juvenile::m_InPond, TAnimal::m_Location_x, TAnimal::m_Location_y, m_mated, TAnimal::m_OurLandscape, Newt_Base::m_OurPopulationManager, Newt_Base::m_reproductiveinhibition, struct_Newt::NPM, struct_Newt::pondrefs, struct_Newt::reproinhib, Landscape::SupplyElementType(), Landscape::SupplyMaleNewtPresent(), toNewts_Breed, toNewts_Develop, toNewts_Die, tton_Egg, MapErrorMsg::Warn(), struct_Newt::weight, struct_Newt::x, and struct_Newt::y.

Referenced by Step().

◆ st_Develop()

TTypeOfNewtState Newt_Female::st_Develop ( void  )
protectedvirtual

Male development state.

Adds pesticide handling to the Adult version of st_Develop If there is the need to test for pesticide effects then the body-burden is adjusted for yesterdays elimination, then pesticide at this location is determined and any intake stored. InternalPesticideHandlingAndResponse is called, and if the body-burden is greater than the threshold for effects then the impacts are determined.

Reimplemented from Newt_Adult.

1049  {
1056  // Eliminate some/all of yesterdays body burden of PPP by multiplying by 1-the daily elimination rate
1058  // Pick up the pesticide to add to the body burden
1062  }
1063  return Newt_Adult::st_Develop();
1064 }
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets total pesticide for a location.
Definition: Landscape.cpp:586
static double m_AdultPPPElimRate
The daily proportion of PPP body burden that is not eliminated for adults.
Definition: Newt.h:413
virtual TTypeOfNewtState st_Develop(void)
Adult development state.
Definition: Newt.cpp:751
static bool m_test_pesticide_terrestrial
Definition: Newt.h:108
void InternalPesticideHandlingAndResponse()
For handlng of class-specific pesticide effects.
Definition: Newt.cpp:1310
@ ppp_1
Definition: farm.h:422

References InternalPesticideHandlingAndResponse(), Newt_Adult::m_AdultPPPElimRate, Newt_Base::m_body_burden, Newt_Base::m_CurrentNewtState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Newt_Base::m_test_pesticide_terrestrial, ppp_1, Newt_Adult::st_Develop(), Landscape::SupplyPesticide(), and toNewts_Die.

Referenced by Step().

◆ st_EvaluateHabitat()

TTypeOfNewtState Newt_Female::st_EvaluateHabitat ( void  )
protectedvirtual

Adult evaluate habitat behaviour - augmenting the adult behaviour.

The female must not stay in breeding behaviour if she has produced her eggs, so this augmentation of evaluate habitat prevents that happening.

The first thing to determine is whether this is the breeding season or not. This is controlled by the population manager. If it is breeding then:

  • Check if we have already bred this year - if so don't start breeding behaviour again. This is reset at the beginning of the year by the population manager (which is more efficient than all newts asking if its 1st January).
  • Check if we are in a pond, if so return st_Breed
  • Check if we have already produced all the eggs we needed to
  • If not, then return migrate

If in a pond and after the NEWT_BREEDINGSEAONEND but before NEWT_BREEDINGSEAONEND+30 then it will disperse based on a probability which reaches unity by NEWT_BREEDINGSEAONEND+30. If its not the breeding season and not in pond then evaluate habitat and determine the dispersal necessity. This is identical to the juvenile st_EvaluateHabitat, which is what is called.

Reimplemented from Newt_Adult.

1120  {
1138  int breedornot = m_OurPopulationManager->IsBreedingSeason();
1139  if (breedornot == 0) {
1141  {
1142  if (m_InPond != -1) return toNewts_Breed;
1143  else
1144  {
1145  return toNewts_Migrate;
1146  }
1147  }
1148  }
1149  else
1150  {
1151  if (m_InPond)
1152  {
1153  if (breedornot > 30)
1154  {
1155  m_forcedisperse = true;
1156  }
1157  else if (g_rand_uni() < (breedornot / 30.0)) return toNewts_Develop;
1158  }
1159  }
1161 }
@ toNewts_Migrate
Definition: Newt.h:72
virtual TTypeOfNewtState st_EvaluateHabitat(void)
Juvenile evaluate habitat behaviour.
Definition: Newt.cpp:472
bool m_forcedisperse
A flag to force dispersal from the breeding ponds.
Definition: Newt.h:371

References g_rand_uni, Newt_Population_Manager::IsBreedingSeason(), m_eggproductionvolume, m_eggsproduced, Newt_Juvenile::m_forcedisperse, Newt_Juvenile::m_InPond, Newt_Base::m_OurPopulationManager, Newt_Juvenile::st_EvaluateHabitat(), toNewts_Breed, toNewts_Develop, and toNewts_Migrate.

Referenced by Step().

◆ Step()

void Newt_Female::Step ( void  )
virtual

Newt_Female Step code. This is called continuously until all animals report that they are 'DONE'.

Reimplemented from Newt_Juvenile.

1006  {
1007  if (m_StepDone || m_CurrentStateNo == -1) return;
1008  switch (m_CurrentNewtState) {
1009  case toNewts_InitialState: // Initial state always starts with develop
1011  break;
1012  case toNewts_Develop:
1013  m_CurrentNewtState = st_Develop(); // Will return toNewts_Die, toNewts_Overwinter, toNewts_EvaluateLocation
1014  break;
1015  case toNewts_Dispersal:
1016  m_CurrentNewtState = st_Disperse(); // Will return toNewts_Develop or toNewts_Die
1017  break;
1018  case toNewts_Migrate:
1019  m_CurrentNewtState = st_Migrate(); // Will return toNewts_Develop, toNewts_Breed or toNewts_Die
1020  m_StepDone = true;
1021  break;
1023  m_CurrentNewtState = st_EvaluateHabitat(); // will return toNewts_Breed, toNewts_Migrate, toNewts_Develop, toNewts_Dispersal
1024  m_StepDone = true;
1025  break;
1026  case toNewts_Overwinter:
1027  m_CurrentNewtState = st_Overwinter(); // will return toNewts_Migrate, toNewts_Develop, toNewts_Dispersal
1028  m_StepDone = true;
1029  break;
1030  case toNewts_Breed:
1031  m_CurrentNewtState = st_Breed(); // will return toNewts_Breed, toNewts_Develop, or toNewts_Die
1032  m_StepDone = true;
1033  break;
1034  case toNewts_Die:
1035  st_Dying(); // No return
1036  m_StepDone = true;
1037  break;
1038  case toNewts_Remove:
1039  m_CurrentStateNo = -1;
1040  m_StepDone = true;
1041  break;
1042  default:
1043  m_OurLandscape->Warn( "Newt_Female::Step()", " unknown state" );
1044  exit( 1 );
1045  }
1046 }
@ toNewts_Dispersal
Definition: Newt.h:71
@ toNewts_EvaluateLocation
Definition: Newt.h:68
@ toNewts_Remove
Definition: Newt.h:70
@ toNewts_Overwinter
Definition: Newt.h:74
@ toNewts_InitialState
Definition: Newt.h:66
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
virtual TTypeOfNewtState st_Disperse(void)
Adult development state.
Definition: Newt.cpp:726
virtual TTypeOfNewtState st_Migrate(void)
Adult migration to pond state.
Definition: Newt.cpp:820
virtual TTypeOfNewtState st_Overwinter(void)
Adult dormant state.
Definition: Newt.cpp:811
void st_Dying(void)
Behavioural state dying.
Definition: Newt.cpp:87
virtual TTypeOfNewtState st_Develop(void)
Male development state.
Definition: Newt.cpp:1049
virtual TTypeOfNewtState st_EvaluateHabitat(void)
Adult evaluate habitat behaviour - augmenting the adult behaviour.
Definition: Newt.cpp:1120
virtual TTypeOfNewtState st_Breed(void)
Female breeding in pond.
Definition: Newt.cpp:1067
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118

References Newt_Base::m_CurrentNewtState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Breed(), st_Develop(), Newt_Adult::st_Disperse(), Newt_Base::st_Dying(), st_EvaluateHabitat(), Newt_Adult::st_Migrate(), Newt_Adult::st_Overwinter(), toNewts_Breed, toNewts_Develop, toNewts_Die, toNewts_Dispersal, toNewts_EvaluateLocation, toNewts_InitialState, toNewts_Migrate, toNewts_Overwinter, toNewts_Remove, and Landscape::Warn().

Member Data Documentation

◆ m_eggdailyproductionvolume

unsigned Newt_Female::m_eggdailyproductionvolume = cfg_newtdailyeggproductionvolume.value()
static

Parameter - holds the number of eggs produced per day during breeding.

Referenced by Newt_Population_Manager::Newt_Population_Manager(), and st_Breed().

◆ m_eggproductionvolume

unsigned Newt_Female::m_eggproductionvolume = cfg_newteggproductionvolume.value()
static

Parameter - holds the max number of eggs that can be produced during breeding.

Newt_Female adds the following attributes to Newt_Adult:

  • m_eggproductionvolume Parameter - holds the max number of eggs that can be produced during breeding
  • m_eggdailyproductionvolume Parameter - holds the number of eggs produced per day during breeding
  • m_eggsproduced is used to keep track of the actual number of eggs produced
  • m_mated which is used to record whether the newt is mated or not this season

The only new behaviour added to the Newt_Female class is st_Breed which is responsible for carrying out the breeding behaviour when the newt is in the pond

Referenced by Newt_Population_Manager::Newt_Population_Manager(), st_Breed(), and st_EvaluateHabitat().

◆ m_eggsproduced

unsigned Newt_Female::m_eggsproduced
protected

Holds the number of eggs produced during breeding.

Referenced by Newt_Female(), ReInit(), ResetEggProduction(), st_Breed(), and st_EvaluateHabitat().

◆ m_mated

bool Newt_Female::m_mated
protected

Flag showing mating status, true means mated this season.

Referenced by Newt_Female(), ReInit(), and st_Breed().


The documentation for this class was generated from the following files: